<%--
  Created by IntelliJ IDEA.
  User: 郭鹏
  Date: 2017/4/13
  Time: 17:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/WEB-INF/view/modules/sys/include/taglib.jsp"%>
<%@ include file="/WEB-INF/view/modules/sys/include/head.jsp"%>
<div class="main-container">
    <div class="padding-md">
${message}
    <div>
        <table>
            <tr>
                <th>编号</th>
                <th>评论文章ID</th>
                <th>前台评论人</th>
                <th>评论日期</th>
                <th>评论内容</th>
                <th>回复的评论id</th>
                <th>编辑</th>
            </tr>
            <c:forEach items="${commentList}" var="comment">
                <tr>
                    <td>${comment.id}</td>
                    <td>${comment.articleId}</td>
                    <td>${comment.createUser}</td>
                    <td>${comment.createDate}</td>
                    <td>${comment.content}</td>
                    <td>${comment.parentId}</td>
                    <td><a href="${ctx}/comment/delete?id=${comment.id}">删除</a></td>
                </tr>
            </c:forEach>
        </table>
        <div>
            <div class ="pager">
                <table class="gridtable" style="width:100%;text-align: center;">
                    <tr>
                        <%--上一页 hasPreviousPage布尔值是否有上一页，prePage上一页页面--%>
                        <c:if test="${page.hasPreviousPage}">
                            <td><a href="${ctx}/comment/findall?pageNum=${page.prePage}&pageSize=${page.pageSize}">前一页</a></td>
                        </c:if>
                        <%--navigatepageNums 集合所有页码  --%>
                        <c:forEach items="${page.navigatepageNums}" var="nav">
                            <c:if test="${nav == page.pageNum}">
                                <td style="font-weight: bold;">${nav}</td>
                            </c:if>
                            <c:if test="${nav != page.pageNum}">
                                <td><a href="${ctx}/comment/findall?pageNum=${nav}&pageSize=${page.pageSize}">${nav}</a></td>
                            </c:if>
                        </c:forEach>
                        <%--hasNextPage 布尔值判断是否有下一页 nextPage下一页的页码--%>
                        <c:if test="${page.hasNextPage}">
                            <td><a href="${ctx}/comment/findall?pageNum=${page.nextPage}&pageSize=${page.pageSize}">下一页</a></td>
                        </c:if>
                    </tr>
                </table>
            </div>
        </div>
    </div>
<a href="${ctx}/comment/findall">查看所有评论</a>
</body>
    </div>
    </div>
<%@include file="/WEB-INF/view/modules/sys/include/footerlib.jsp"%>
</html>
